// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.
use crate::Result;

/// Implements a [DataAccessControlService](super::stub::DataAccessControlService) decorator for logging and tracing.
#[derive(Clone, Debug)]
pub struct DataAccessControlService<T>
where
    T: super::stub::DataAccessControlService + std::fmt::Debug + Send + Sync,
{
    inner: T,
}

impl<T> DataAccessControlService<T>
where
    T: super::stub::DataAccessControlService + std::fmt::Debug + Send + Sync,
{
    pub fn new(inner: T) -> Self {
        Self { inner }
    }
}

impl<T> super::stub::DataAccessControlService for DataAccessControlService<T>
where
    T: super::stub::DataAccessControlService + std::fmt::Debug + Send + Sync,
{
    #[tracing::instrument(ret)]
    async fn create_data_access_label(
        &self,
        req: crate::model::CreateDataAccessLabelRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::DataAccessLabel>> {
        self.inner.create_data_access_label(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_data_access_label(
        &self,
        req: crate::model::GetDataAccessLabelRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::DataAccessLabel>> {
        self.inner.get_data_access_label(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_data_access_labels(
        &self,
        req: crate::model::ListDataAccessLabelsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListDataAccessLabelsResponse>> {
        self.inner.list_data_access_labels(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_data_access_label(
        &self,
        req: crate::model::UpdateDataAccessLabelRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::DataAccessLabel>> {
        self.inner.update_data_access_label(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_data_access_label(
        &self,
        req: crate::model::DeleteDataAccessLabelRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_data_access_label(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_data_access_scope(
        &self,
        req: crate::model::CreateDataAccessScopeRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::DataAccessScope>> {
        self.inner.create_data_access_scope(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_data_access_scope(
        &self,
        req: crate::model::GetDataAccessScopeRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::DataAccessScope>> {
        self.inner.get_data_access_scope(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_data_access_scopes(
        &self,
        req: crate::model::ListDataAccessScopesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListDataAccessScopesResponse>> {
        self.inner.list_data_access_scopes(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_data_access_scope(
        &self,
        req: crate::model::UpdateDataAccessScopeRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::DataAccessScope>> {
        self.inner.update_data_access_scope(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_data_access_scope(
        &self,
        req: crate::model::DeleteDataAccessScopeRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_data_access_scope(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_operations(
        &self,
        req: longrunning::model::ListOperationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::ListOperationsResponse>> {
        self.inner.list_operations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_operation(
        &self,
        req: longrunning::model::GetOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.get_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_operation(
        &self,
        req: longrunning::model::DeleteOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn cancel_operation(
        &self,
        req: longrunning::model::CancelOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.cancel_operation(req, options).await
    }
}

/// Implements a [EntityService](super::stub::EntityService) decorator for logging and tracing.
#[derive(Clone, Debug)]
pub struct EntityService<T>
where
    T: super::stub::EntityService + std::fmt::Debug + Send + Sync,
{
    inner: T,
}

impl<T> EntityService<T>
where
    T: super::stub::EntityService + std::fmt::Debug + Send + Sync,
{
    pub fn new(inner: T) -> Self {
        Self { inner }
    }
}

impl<T> super::stub::EntityService for EntityService<T>
where
    T: super::stub::EntityService + std::fmt::Debug + Send + Sync,
{
    #[tracing::instrument(ret)]
    async fn get_watchlist(
        &self,
        req: crate::model::GetWatchlistRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Watchlist>> {
        self.inner.get_watchlist(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_watchlists(
        &self,
        req: crate::model::ListWatchlistsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListWatchlistsResponse>> {
        self.inner.list_watchlists(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_watchlist(
        &self,
        req: crate::model::CreateWatchlistRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Watchlist>> {
        self.inner.create_watchlist(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_watchlist(
        &self,
        req: crate::model::UpdateWatchlistRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Watchlist>> {
        self.inner.update_watchlist(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_watchlist(
        &self,
        req: crate::model::DeleteWatchlistRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_watchlist(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_operations(
        &self,
        req: longrunning::model::ListOperationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::ListOperationsResponse>> {
        self.inner.list_operations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_operation(
        &self,
        req: longrunning::model::GetOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.get_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_operation(
        &self,
        req: longrunning::model::DeleteOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn cancel_operation(
        &self,
        req: longrunning::model::CancelOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.cancel_operation(req, options).await
    }
}

/// Implements a [InstanceService](super::stub::InstanceService) decorator for logging and tracing.
#[derive(Clone, Debug)]
pub struct InstanceService<T>
where
    T: super::stub::InstanceService + std::fmt::Debug + Send + Sync,
{
    inner: T,
}

impl<T> InstanceService<T>
where
    T: super::stub::InstanceService + std::fmt::Debug + Send + Sync,
{
    pub fn new(inner: T) -> Self {
        Self { inner }
    }
}

impl<T> super::stub::InstanceService for InstanceService<T>
where
    T: super::stub::InstanceService + std::fmt::Debug + Send + Sync,
{
    #[tracing::instrument(ret)]
    async fn get_instance(
        &self,
        req: crate::model::GetInstanceRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Instance>> {
        self.inner.get_instance(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_operations(
        &self,
        req: longrunning::model::ListOperationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::ListOperationsResponse>> {
        self.inner.list_operations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_operation(
        &self,
        req: longrunning::model::GetOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.get_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_operation(
        &self,
        req: longrunning::model::DeleteOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn cancel_operation(
        &self,
        req: longrunning::model::CancelOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.cancel_operation(req, options).await
    }
}

/// Implements a [ReferenceListService](super::stub::ReferenceListService) decorator for logging and tracing.
#[derive(Clone, Debug)]
pub struct ReferenceListService<T>
where
    T: super::stub::ReferenceListService + std::fmt::Debug + Send + Sync,
{
    inner: T,
}

impl<T> ReferenceListService<T>
where
    T: super::stub::ReferenceListService + std::fmt::Debug + Send + Sync,
{
    pub fn new(inner: T) -> Self {
        Self { inner }
    }
}

impl<T> super::stub::ReferenceListService for ReferenceListService<T>
where
    T: super::stub::ReferenceListService + std::fmt::Debug + Send + Sync,
{
    #[tracing::instrument(ret)]
    async fn get_reference_list(
        &self,
        req: crate::model::GetReferenceListRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ReferenceList>> {
        self.inner.get_reference_list(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_reference_lists(
        &self,
        req: crate::model::ListReferenceListsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListReferenceListsResponse>> {
        self.inner.list_reference_lists(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_reference_list(
        &self,
        req: crate::model::CreateReferenceListRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ReferenceList>> {
        self.inner.create_reference_list(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_reference_list(
        &self,
        req: crate::model::UpdateReferenceListRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ReferenceList>> {
        self.inner.update_reference_list(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_operations(
        &self,
        req: longrunning::model::ListOperationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::ListOperationsResponse>> {
        self.inner.list_operations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_operation(
        &self,
        req: longrunning::model::GetOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.get_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_operation(
        &self,
        req: longrunning::model::DeleteOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn cancel_operation(
        &self,
        req: longrunning::model::CancelOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.cancel_operation(req, options).await
    }
}

/// Implements a [RuleService](super::stub::RuleService) decorator for logging and tracing.
#[derive(Clone, Debug)]
pub struct RuleService<T>
where
    T: super::stub::RuleService + std::fmt::Debug + Send + Sync,
{
    inner: T,
}

impl<T> RuleService<T>
where
    T: super::stub::RuleService + std::fmt::Debug + Send + Sync,
{
    pub fn new(inner: T) -> Self {
        Self { inner }
    }
}

impl<T> super::stub::RuleService for RuleService<T>
where
    T: super::stub::RuleService + std::fmt::Debug + Send + Sync,
{
    #[tracing::instrument(ret)]
    async fn create_rule(
        &self,
        req: crate::model::CreateRuleRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Rule>> {
        self.inner.create_rule(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_rule(
        &self,
        req: crate::model::GetRuleRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Rule>> {
        self.inner.get_rule(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_rules(
        &self,
        req: crate::model::ListRulesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListRulesResponse>> {
        self.inner.list_rules(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_rule(
        &self,
        req: crate::model::UpdateRuleRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Rule>> {
        self.inner.update_rule(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_rule(
        &self,
        req: crate::model::DeleteRuleRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_rule(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_rule_revisions(
        &self,
        req: crate::model::ListRuleRevisionsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListRuleRevisionsResponse>> {
        self.inner.list_rule_revisions(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_retrohunt(
        &self,
        req: crate::model::CreateRetrohuntRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.create_retrohunt(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_retrohunt(
        &self,
        req: crate::model::GetRetrohuntRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Retrohunt>> {
        self.inner.get_retrohunt(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_retrohunts(
        &self,
        req: crate::model::ListRetrohuntsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListRetrohuntsResponse>> {
        self.inner.list_retrohunts(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_rule_deployment(
        &self,
        req: crate::model::GetRuleDeploymentRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::RuleDeployment>> {
        self.inner.get_rule_deployment(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_rule_deployments(
        &self,
        req: crate::model::ListRuleDeploymentsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListRuleDeploymentsResponse>> {
        self.inner.list_rule_deployments(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_rule_deployment(
        &self,
        req: crate::model::UpdateRuleDeploymentRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::RuleDeployment>> {
        self.inner.update_rule_deployment(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_operations(
        &self,
        req: longrunning::model::ListOperationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::ListOperationsResponse>> {
        self.inner.list_operations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_operation(
        &self,
        req: longrunning::model::GetOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.get_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_operation(
        &self,
        req: longrunning::model::DeleteOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn cancel_operation(
        &self,
        req: longrunning::model::CancelOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.cancel_operation(req, options).await
    }

    fn get_polling_error_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_error_policy::PollingErrorPolicy> {
        self.inner.get_polling_error_policy(options)
    }

    fn get_polling_backoff_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_backoff_policy::PollingBackoffPolicy> {
        self.inner.get_polling_backoff_policy(options)
    }
}
